/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.risk.control.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.hopes.bizz.risk.common.constant.enums.RiskModDictEnum;
import com.hopes.bizz.risk.common.constant.enums.RiskSysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 装置停用检维修记录
 *
 * @author cx
 * @date 2023-07-17 19:39:27
 */
@Data
@TableName("risk_unit_stop")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "装置停用检维修记录")
public class RiskUnitStopEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;

 
	/**
	* id
	*/
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description="id")
    private Long id;

	/**
	* 风险单元标识
	*/
    @Schema(description="风险单元标识")
    private Long riskUnitId;

	/**
	* 停用类型
	*/
    @Schema(description="停用类型")
    private Integer stopType;

	/**
	* 停用开始时间
	*/
    @Schema(description="停用开始时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date stopStartTime;

	/**
	* 停用结束时间
	*/
    @Schema(description="停用结束时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date stopEndTime;

	/**
	* 原因
	*/
    @Schema(description="原因")
    private String stopReason;

	/**
	* 备注
	*/
    @Schema(description="备注")
    private String remarks;

	/**
	* 机构ID
	*/
    @Schema(description="机构ID")
    private Long orgId;

	public String getRiskUnitIdStr() {
		String itemLabelByValue = DictResolver.getItemLabelByValue(RiskModDictEnum.risk_unit, this.getRiskUnitId());
		return itemLabelByValue;
	}

	public String getStopTypeStr(){
		String itemLabelByValue = DictResolver.getItemLabelByValue(RiskSysDictEnum.risk_stop_type, this.getStopType());
		return itemLabelByValue;
	}

}